package prototype;

/**
 * 调用ShapeCache类来获取存储在Hashtable中的形状的克隆
 */

public class PrototypePatternDemo {
    public static void main(String[] args) {
        ShapeCache.loadCache();

        Shape clonedShape=ShapeCache.getShape("1");
        System.out.println("Shape:"+clonedShape.getType());

        Shape clonedShape1=ShapeCache.getShape("2");
        System.out.println("Shape:"+clonedShape1.getType());

        Shape clonedShape2=ShapeCache.getShape("3");
        System.out.println("Shape:"+clonedShape2.getType());
    }
}
